<%@ page import="cn.edu.lingnan.pojo.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Objects" %><%--
  Created by IntelliJ IDEA.
  User: abc20
  Date: 2024/4/23
  Time: 10:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../css/updateAll.css">
</head>

<body>
<h1 align="center">岭南师范学院学生竞赛系统管理页面----更新页面</h1>
<hr><br><a href="/loginOut" class="link-style">注销</a>
<a href="#" onclick="window.history.back()" class="link-style">返回</a>
<div class="container">
    <form action="updateStu">
    <table>
        <tr>
            <th>学生编号</th>
            <th>学生姓名</th>
            <th>学生密码</th>
            <th>学生性别</th>
            <th>学生专业</th>
            <th>学生年级</th>
            <th>学生权限</th>
            <th>学生备注</th>
            <th>选择操作</th>
        </tr>
        <%
            List<Student> allStu =(List<Student>) session.getAttribute("allStu");
            String sid = request.getParameter("sid");
            for(Student student:allStu){
                if((student.getId()+"").equals(sid)){//id是整数型的，要转换为字符型才能比较
        %>
        <tr><!--sid不能修改，给它隐藏域，因要传递数据 -->
            <td class="narrow-column"><input type="hidden" name="sid" value="<%=student.getId()%>"><%=student.getId()%></td>
            <td><input type="text" name="sname" value="<%=student.getName()%>"></td>
            <td><input type="text" name="password" value="<%=student.getPassword()%>"></td>
            <td><input type="text" name="gender" value="<%=student.getGender()%>"></td>
            <td><input type="text" name="major" value="<%=student.getMajor()%>"></td>
            <td><input type="text" name="class" value="<%=student.getClassX()%>"></td>
            <td class="narrow-column"><input type="hidden" name="right" value="<%=student.getRight()%>"><%=student.getRight()%></td>
            <td><input type="text" name="flag" value="<%=student.getFlag()%>"></td>
            <td>
                <input type="submit" value="确认修改"/>
            </td>
        </tr>
        <%
            }
            }
        %>
    </table>
    </form>
</div>

</body>
</html>
